package com.ziyueyuwen.xiniao.bean.product;

import com.ziyueyuwen.xiniao.bean.ZyProductStage;
import com.ziyueyuwen.xiniao.enums.ProductClassRuleEnum;

import java.util.List;

/**
 * Created by wancheng on 2019/4/4.
 */
public class SaleStageVO{

    /**
     * 商品id
     */
    private Integer productId;

    private Integer stageId;

    private String stageName;

    private String classRule;

    private List<SaleProductVO> products;

    public SaleStageVO(Integer stageId, String stageName, List<SaleProductVO> products) {
        this.stageId = stageId;
        this.stageName = stageName;
        this.products = products;
    }

    public SaleStageVO(Integer stageId, String stageName, ProductClassRuleEnum classRule) {
        this.stageId = stageId;
        this.stageName = stageName;
        this.classRule = classRule.getDesc();
    }

    public List<SaleProductVO> getProducts() {
        return products;
    }

    public void setProducts(List<SaleProductVO> products) {
        this.products = products;
    }

    public Integer getStageId() {
        return stageId;
    }

    public void setStageId(Integer stageId) {
        this.stageId = stageId;
    }

    public String getStageName() {
        return stageName;
    }

    public void setStageName(String stageName) {
        this.stageName = stageName;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getClassRule() {
        return classRule;
    }

    public void setClassRule(String classRule) {
        this.classRule = classRule;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SaleStageVO that = (SaleStageVO) o;

        return stageId.equals(that.stageId);

    }

    @Override
    public int hashCode() {
        return stageId.hashCode();
    }
}
